using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.QuadPack
{
    /// <summary>
    /// DQAWC - Computation of Cauchy principal value.
    /// </summary>
    [Serializable]
    public static class DqawcClass
    {
        /// <summary>
        /// Computation of Cauchy principal value.
        /// </summary>
        /// <param name="f">Double precision function to be integrated.</param>
        /// <param name="a">Lower limit of integration.</param>
        /// <param name="b">Upper limit of integration.</param>
        /// <param name="c">The parameter in the weight function.</param>
        /// <param name="epsabs">The absolute accuracy requested.</param>
        /// <param name="epsrel">The relative accuracy requested.</param>
        /// <param name="abserr">The estimate of the modulus of the absolute error.</param>
        /// <param name="neval">The needed function evalations.</param>
        /// <param name="ier">The requested errorcode.</param>
        /// <returns>The computed Cauchy principal value.</returns>
        public static double Dqawc(HardRealFunction f, double a, double b, double c, double epsabs, double epsrel,
                                   ref double abserr, ref int neval, ref int ier)
        {
            double result;

            result = DqawceClass.Dqawce(f, a, b, c, epsabs, epsrel, ref abserr, ref neval, ref ier);
            return result;
        }
    }
}